package com.nineclock.doc.controller;

import com.nineclock.common.entity.PageResult;
import com.nineclock.common.entity.Result;
import com.nineclock.doc.service.PageResultService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：zhouc
 * @date ：Created in 2021/6/28
 * @description ：
 * @version: 1.0
 */
@RestController
@RequestMapping
public class PageResultController {
    
    @Autowired
    PageResultService pageResultService;
    
    @GetMapping("/pagingFile")
    public Result<PageResult> pageResults(
        @RequestParam(value = "page",required = false) Long page,
        @RequestParam(value = "pageSize",required = false) Long pageSize,
        @RequestParam(value = "keyword",required = false) String keyword){
    
        PageResult pageResult = pageResultService.pageResults(page,pageSize,keyword);
        return Result.success(pageResult);
    }

}
